<template>

	<view style="position: absolute;left: 0; top: 0;">
		<u-navbar title-size="28" :is-back="false" :title="title" :background="background" :title-color="`white`" :border-bottom="false"
			:height="height" />
	</view>

</template>

<script>
	// app中的全局需要在每个页面进行引入
	import app from '../../App.vue'
	export default {

		name: "topBarWord",

		props: {
			// 接受父组件的传值
			title: {
				type: String,
			}
		},
		created() {
			this.getSystemInfo()
		},
		data() {
			return {
				height: 0,
				background: {
					backgroundColor: 'rgba(0,0,0,0)',
					// 导航栏背景图
					// background: 'url(https://cdn.uviewui.com/uview/swiper/1.jpg) no-repeat',
					// 还可以设置背景图size属性
					// backgroundSize: 'cover',
					// 渐变色
					// backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
				},
			};
		},
		// 事件
		methods: {
			getSystemInfo() {
				let that = this
				uni.getSystemInfo({
					success: function(e) {
						// // #ifndef MP
						// Vue.prototype.StatusBar = e.statusBarHeight;
						// if (e.platform == 'android') {
						// 	Vue.prototype.CustomBar = e.statusBarHeight + 50;
						// } else {
						// 	Vue.prototype.CustomBar = e.statusBarHeight + 45;
						// };
						// #endif
						// #ifdef MP-WEIXIN
						// Vue.prototype.StatusBar = e.statusBarHeight;
						// let custom = wx.getMenuButtonBoundingClientRect();
						// Vue.prototype.Custom = custom;
						// Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
						let custom = wx.getMenuButtonBoundingClientRect();
						let statusBarHeight = e.statusBarHeight;
						let CustomBar = custom.bottom + custom.top - e.statusBarHeight;
		
		
						that.height = statusBarHeight

					 
						// #endif       
						// #ifdef MP-ALIPAY
						// Vue.prototype.StatusBar = e.statusBarHeight;
						// Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
						// #endif
					}
				})
			},
		},
	}
</script>

<style scoped>

</style>
